/*
 * @Author: lvye
 * @Description:
 * @Date: 2023-06-28 10:23:19
 * @LastEditTime: 2023-10-12 18:26:57
 * @FilePath: \vue3-ts\vue.config.js
 */
const AutoImport = require("unplugin-auto-import/webpack")
const Components = require("unplugin-vue-components/webpack")
const { ElementPlusResolver } = require("unplugin-vue-components/resolvers")
const { defineConfig } = require("@vue/cli-service")
module.exports = defineConfig({
  transpileDependencies: true,
  // outputDir: "./build",
  // publicPath: "./", //为了本地打包后index。html可以正常运行  部署到服务器需要删掉 可以根据环境变量做配置
  devServer: {
    proxy: {
      "^/api": {
        target: "http://hn216.api.yesapi.cn/api/App/User",
        pathRewrite: {
          "^/api": ""
        },
        changeOrigin: true
      }
    }
  },
  //其他配置....
  configureWebpack: {
    plugins: [
      AutoImport({
        resolvers: [ElementPlusResolver()]
      }),
      Components({
        resolvers: [ElementPlusResolver()]
      })
    ]
  }
})
